﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Shrestha.Charts.Graph;
using System.Windows;

namespace Shrestha.Charts.Commands
{
    class ScreenshotCommand : ICommand
    {
        public ScreenshotCommand(IViewModel cwvm)
        {
            this._vm = cwvm;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            String filename = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\storygraph_" + DateTime.Now.ToFileTime() + ".png";
            GraphUtils.SaveWindow((Window)_vm.GetWindow(), 96, filename );
        }

        private IViewModel _vm { get; set; }
    }
}

